/*
 * ConfiguracionVentana.java
 *
 */

package ar.com.educacionit.vehiculos.ventanas;

/**
 *
 * @author  Sebastian S. Sanga <SebastianSanga@gmail.com>
 */
public class ConfiguracionVentana extends javax.swing.JInternalFrame {
    
    // Atributo para manejar si hay una ventana abierta de este tipo
    public static boolean abierta = false;
    
    public ConfiguracionVentana() {
        
        // Llama al constructor de la superclase y establece las caracteristicas de ventana
        super("Configuracion",
          true, //resizable
          true, //closable
          true, //maximizable
          true);//iconifiable
        
        // Establece en true el atributo abierto representando que hay una ventana de este tipo abierta
        abierta = true;
        
        // Invoca al metodo initComponents()
        initComponents();    
        
        // Carga los datos de la configuracion
        cargarDatos();
    }    
    
    public void cargarDatos(){
        txtSistemaOperativo.setText( System.getProperty("os.name") );
        txtUsuario.setText( System.getProperty("user.name") );
        txtClassPath.setText( System.getProperty("java.class.path") );
    }
    
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        txtSistemaOperativo = new javax.swing.JTextField();
        txtUsuario = new javax.swing.JTextField();
        txtClassPath = new javax.swing.JTextField();
        btnCerrar = new javax.swing.JButton();

        jLabel1.setText("Sistema Operativo");

        jLabel2.setText("Usuario");

        jLabel3.setText("ClassPath");

        txtSistemaOperativo.setEditable(false);

        txtUsuario.setEditable(false);

        txtClassPath.setEditable(false);

        btnCerrar.setText("Cerrar");
        btnCerrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCerrarActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel1)
                    .add(jLabel2)
                    .add(jLabel3))
                .add(18, 18, 18)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(txtClassPath)
                    .add(txtUsuario)
                    .add(txtSistemaOperativo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 228, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(50, Short.MAX_VALUE))
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                .addContainerGap(321, Short.MAX_VALUE)
                .add(btnCerrar)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(21, 21, 21)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel1)
                    .add(txtSistemaOperativo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(16, 16, 16)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel2)
                    .add(txtUsuario, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(18, 18, 18)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel3)
                    .add(txtClassPath, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 136, Short.MAX_VALUE)
                .add(btnCerrar)
                .addContainerGap())
        );
        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnCerrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCerrarActionPerformed
        this.dispose();
    }//GEN-LAST:event_btnCerrarActionPerformed
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnCerrar;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JTextField txtClassPath;
    private javax.swing.JTextField txtSistemaOperativo;
    private javax.swing.JTextField txtUsuario;
    // End of variables declaration//GEN-END:variables
    
}
